/*© 2010-2011 mOcean Mobile. A subsidiary of Mojiva, Inc. All Rights Reserved.*/
package com.adserver.adview;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.logging.Level;

public class AdServerWindowListener extends WindowAdapter {
    private AdServerView adServerView;

    public AdServerWindowListener(AdServerView adServerView) {
        this.adServerView = adServerView;
    }

    public void windowClosing(WindowEvent e) {
        super.windowClosing(e);
        adServerView.OnWindowClosing();
    }

    @Override
    public void windowOpened(WindowEvent e) {
        super.windowOpened(e);
        Logger.getInstance().logText(Level.INFO, "windowOpened event");
        adServerView.OnWindowOpened();
    }

    @Override
    public void windowIconified(WindowEvent e) {
        super.windowIconified(e);
        Logger.getInstance().logText(Level.INFO, "windowIconified event");
        adServerView.OnWindowDectivated();
    }

    @Override
    public void windowDeiconified(WindowEvent e) {
        super.windowDeiconified(e);
        Logger.getInstance().logText(Level.INFO, "windowDeiconified event");
        adServerView.OnWindowActivated();
    }

}